/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.fii.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Zeus
 */
@Entity
@Table(name = "pg_historial", catalog = "prog_acad", schema = "")
@NamedQueries({
    @NamedQuery(name = "PgHistorial.findAll", query = "SELECT p FROM PgHistorial p"),
    @NamedQuery(name = "PgHistorial.findByPgcodAlumno", query = "SELECT p FROM PgHistorial p WHERE p.pgHistorialPK.pgcodAlumno = :pgcodAlumno"),
    @NamedQuery(name = "PgHistorial.findByPgcodCurso", query = "SELECT p FROM PgHistorial p WHERE p.pgHistorialPK.pgcodCurso = :pgcodCurso"),
    @NamedQuery(name = "PgHistorial.findByPgSemestre", query = "SELECT p FROM PgHistorial p WHERE p.pgHistorialPK.pgSemestre = :pgSemestre"),
    @NamedQuery(name = "PgHistorial.findByPgNota", query = "SELECT p FROM PgHistorial p WHERE p.pgNota = :pgNota"),
    @NamedQuery(name = "PgHistorial.findByPgcodFacultad", query = "SELECT p FROM PgHistorial p WHERE p.pgcodFacultad = :pgcodFacultad"),
    @NamedQuery(name = "PgHistorial.findByPgSeccion", query = "SELECT p FROM PgHistorial p WHERE p.pgSeccion = :pgSeccion")})
public class PgHistorial implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected PgHistorialPK pgHistorialPK;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "pg_nota", nullable = false, precision = 6, scale = 2)
    private BigDecimal pgNota;
    @Column(name = "pg_codFacultad", length = 2)
    private String pgcodFacultad;
    @Basic(optional = false)
    @Column(name = "pg_seccion", nullable = false, length = 2)
    private String pgSeccion;

    public PgHistorial() {
    }

    public PgHistorial(PgHistorialPK pgHistorialPK) {
        this.pgHistorialPK = pgHistorialPK;
    }

    public PgHistorial(PgHistorialPK pgHistorialPK, BigDecimal pgNota, String pgSeccion) {
        this.pgHistorialPK = pgHistorialPK;
        this.pgNota = pgNota;
        this.pgSeccion = pgSeccion;
    }

    public PgHistorial(String pgcodAlumno, String pgcodCurso, String pgSemestre) {
        this.pgHistorialPK = new PgHistorialPK(pgcodAlumno, pgcodCurso, pgSemestre);
    }

    public PgHistorialPK getPgHistorialPK() {
        return pgHistorialPK;
    }

    public void setPgHistorialPK(PgHistorialPK pgHistorialPK) {
        this.pgHistorialPK = pgHistorialPK;
    }

    public BigDecimal getPgNota() {
        return pgNota;
    }

    public void setPgNota(BigDecimal pgNota) {
        this.pgNota = pgNota;
    }

    public String getPgcodFacultad() {
        return pgcodFacultad;
    }

    public void setPgcodFacultad(String pgcodFacultad) {
        this.pgcodFacultad = pgcodFacultad;
    }

    public String getPgSeccion() {
        return pgSeccion;
    }

    public void setPgSeccion(String pgSeccion) {
        this.pgSeccion = pgSeccion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pgHistorialPK != null ? pgHistorialPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PgHistorial)) {
            return false;
        }
        PgHistorial other = (PgHistorial) object;
        if ((this.pgHistorialPK == null && other.pgHistorialPK != null) || (this.pgHistorialPK != null && !this.pgHistorialPK.equals(other.pgHistorialPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.fii.entity.PgHistorial[ pgHistorialPK=" + pgHistorialPK + " ]";
    }
    
}
